﻿CREATE FUNCTION dbo.IsPayOutLinked
	(
	@ID int
	)
RETURNS int
AS
	BEGIN
	DECLARE @countID int
	SELECT @countID = COUNT(PAYMENT_OUT_ID) FROM PAY_OUT_ON_INV_IN WHERE PAYMENT_OUT_ID = @ID
	RETURN @countID
	END